﻿using System;
using System.Data;
using System.Data.OleDb;

using Joel.ImpresionesJL.AccesoDatos.Interfaces;

namespace Joel.ImpresionesJL.AccesoDatos
{
    public class ServicioDatosTipo : ServicioDatosBase, IServicioDatosTipo
    {
        #region Constructores

        public ServicioDatosTipo()
        { }

        #endregion

        #region Atributos



        #endregion

        #region Propiedades



        #endregion

        #region Metodos

        public DataSet TiposTelefonos_DevolverTodos()
        {
            try
            {
                OleDbCommand cm = new OleDbCommand("TiposTelefonos_DevolverTodos", Conexion);
                cm.CommandType = CommandType.StoredProcedure;
                OleDbDataAdapter da = new OleDbDataAdapter(cm);
                DataSet ds = new DataSet();
                da.Fill(ds);
                return ds;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (Conexion.State == ConnectionState.Open)
                    Conexion.Close();
            }
        }

        public DataSet TiposFormasPagos_DevolverTodos()
        {
            try
            {
                OleDbCommand cm = new OleDbCommand("TiposFormasPagos_DevolverTodos", Conexion);
                cm.CommandType = CommandType.StoredProcedure;
                OleDbDataAdapter da = new OleDbDataAdapter(cm);
                DataSet ds = new DataSet();
                da.Fill(ds);
                return ds;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (Conexion.State == ConnectionState.Open)
                    Conexion.Close();
            }
        }

        public DataSet TiposMovimientos_DevolverTodos()
        {
            try
            {
                OleDbCommand cm = new OleDbCommand("TiposMovimientos_DevolverTodos", Conexion);
                cm.CommandType = CommandType.StoredProcedure;
                OleDbDataAdapter da = new OleDbDataAdapter(cm);
                DataSet ds = new DataSet();
                da.Fill(ds);
                return ds;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (Conexion.State == ConnectionState.Open)
                    Conexion.Close();
            }
        }

        #endregion
    }
}
